//水平方向的列表
function setProductList_Hor(obj){
	var str='',sumCount=0,resultArr=[];
	if (obj.bs_result == BS_RESULT.OK) {
		var bvc_vector = obj.bvc_vector;	
		if(bvc_vector.length!=0){
			for(var i=0;i<bvc_vector.length;i++){
				var bvc_pdt = bvc_vector[i].bvc_pdt;
				sumCount+= bvc_pdt.length;
				if(bvc_pdt.length != 0){
					for (var j = 0; j < bvc_pdt.length; j ++) {
						var product = bvc_pdt[j];
						var isOffer= product.bs_is_offer == "Y" ? '<span><em>offer</em></span>' : '';
						str+='<div class="item" data-id="'+product.bj_pdt_id+'" data-item-no="'+product.bs_item_no+                                                                                                                                                                                                                                                                                                                                                                                                                  '">'+
							'<div class="proImg">'+
								'<img src="'+MPJ.apiBase+''+product.bs_limg_file+'"/>'+isOffer+
							'</div>'+
							'<div class="mui-media-body">'+
								'<div class="pro-name">'+product.bs_brand+'</div>'+
								'<div class="pro-f-name">'+product.bs_desc+' '+product.bs_volume+'</div> '+
								'<div class="price">$<em>'+getPrice(product.bj_rsp)+'</em></div>'+
								'<div class="price-num">'+
									'<span>Qty:</span>'+
									'<div class="mui-numbox" data-numbox-min="1" >'+
									  '<button class="mui-btn mui-numbox-btn-minus" type="button">-</button>'+
									  '<input class="mui-numbox-input" type="number" value="1" />'+
									  '<button class="mui-btn mui-numbox-btn-plus" type="button">+</button>'+
									'</div>'+
									'<a href="javascript:void(0)" class="addCar mui-btn" >'+
										'Add<img src="' + MPJ.base + '/resources/images/icon/main-shopcar.png" />'+
									'</a>'+
								'</div>'+
							'</div>'+
						'</div>';
					}
				}else{
					str='';
				}
			}
		}else{
			sumCount=0;
			str='';
		}
		resultArr.push(str,sumCount);
		return resultArr;
	}
}
//垂直方向的列表
function setProductList_ver(obj){
	var str='',sumCount=0,resultArr=[];
	if (obj.bs_result == BS_RESULT.OK) {	
		var bvc_pdt = obj.bvc_pdt;
		if(bvc_pdt.length != 0){
			for (var i = 0; i < bvc_pdt.length; i ++) {
				sumCount= bvc_pdt.length;
				var product = bvc_pdt[i];
				var isOffer= product.bs_is_offer == "Y" ? '<span><em>offer</em></span>' : '';
				str+='<li data-id="'+product.bj_pdt_id+'" data-item-no="'+product.bs_item_no+'">'+
	        		'<div class="mainCon">'+
	            		'<div class="imgBox">'+
	            			'<img src="'+MPJ.apiBase+''+product.bs_limg_file+'"/>'+isOffer+
	            		'</div>'+
	            		'<div class="txtBox">'+
	            			'<h4>'+product.bs_brand+'</h4>'+
	            			'<p>'+product.bs_desc+' '+product.bs_volume+'</p>'+
	            			'<div class="red-font">'+product.bs_prom_text+'</div>'+
	            			'<div class="price orange-font">$<em>'+getPrice(product.bj_rsp)+'</em></div>'+
	            			'<div class="num">'+
	            				'<div class="mui-numbox" data-numbox-min="1" >'+
								  '<button class="mui-btn mui-numbox-btn-minus" type="button">-</button>'+
								  '<input class="mui-numbox-input" type="number" value="1" />'+
								  '<button class="mui-btn mui-numbox-btn-plus" type="button">+</button>'+
								'</div>'+
								'<div class="addCar">'+
									'Add<img src="' + MPJ.base + '/resources/images/icon/main-shopcar.png" />'+
								'</div>'+
	            			'</div>'+
	            		'</div>'+
	        		'</div>'+
	        	'</li>';
	       }
       	}else{
       		sumCount=0;
			str='';
		}
		resultArr.push(str,sumCount);
		return resultArr;
	}
}
//首页的列表
function setProductList_index(obj){
	var str='',sumCount=0,resultArr=[];
	if (obj.bs_result == BS_RESULT.OK) {
		if (obj.bvc_vector.length == 0) {
			return;
		}
		var bvc_pdt = obj.bvc_vector[0];
		if(bvc_pdt.length != 0){
			for (var j = 0; j < bvc_pdt.length; j ++) {
				sumCount= bvc_pdt.length;
				var product = bvc_pdt[j];
				var isOffer= product.bs_is_offer == "Y" ? '<span><em>offer</em></span>' : '';
				var bs_prom_text=product.bs_prom_text == "" ? "" : product.bs_prom_text;
				str+='<li data-id="'+product.bj_pdt_id+'" data-item-no="'+product.bs_item_no+'">'+
	            		'<div class="mainCon">'+
		            		'<div class="imgBox">'+
		            			'<img src="'+MPJ.apiBase+''+product.bs_simg_file+'" />'+isOffer+
		            		'</div>'+
		            		'<div class="txtBox">'+
		            			'<h4>'+product.bs_brand+'</h4>'+
		            			'<p>'+product.bs_desc+' '+product.bs_volume+'</p>'+
		            			'<div class="red-font">'+bs_prom_text +'</div>'+
		            			'<div class="price orange-font">$<em>'+getPrice(product.bj_rsp)+'</em></div>'+
		            			'<div class="num">'+
		            				'<div class="mui-numbox" data-numbox-min="1" >'+
									  '<button class="mui-btn mui-numbox-btn-minus" type="button">-</button>'+
									  '<input class="mui-numbox-input" type="number" value="1" />'+
									 ' <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>'+
									'</div>'+
									'<div class="addCar">'+
										'Add<img src="' + MPJ.base + '/resources/images/icon/main-shopcar.png" />'+
									'</div>'+
		            			'</div>'+
		            		'</div>'+
	            		'</div>'+
	            	'</li>';
	       }
		}else{
			sumCount=0;
			str='';
		}
		resultArr.push(str,sumCount);
		return resultArr;
	}
}
//优惠列表
function setProductList_promotion(obj){
	var bc_group_a_pdt='';
	var bc_group_r_pdt='';
	var promotionArr=[];
	if (obj.bs_result == BS_RESULT.OK) {
		if(obj.bc_group_a_pdt != undefined && obj.bc_group_a_pdt.bvc_pdt != undefined && obj.bc_group_a_pdt.bvc_pdt.length != 0){
			var bvc_pdt_a = obj.bc_group_a_pdt.bvc_pdt;
			for (var i = 0; i < bvc_pdt_a.length; i ++) {
				var product = bvc_pdt_a[i];
				var bs_prom_text=product.bs_prom_text == "" ? "" : product.bs_prom_text;
				bc_group_a_pdt+='<li data-id="'+product.bj_pdt_id+'" data-item-no="'+product.bs_item_no+'">'+
					'<div class="mainCon">'+
						'<div class="imgBox">'+
							'<img src="'+MPJ.apiBase+''+product.bs_simg_file+'" />'+(product.bs_is_offer == "Y" ? '<span><em>offer</em></span>' : '')+
						'</div>'+
						'<div class="txtBox">'+
							'<h4>'+product.bs_brand+'</h4>'+
							'<p>'+product.bs_desc+' '+product.bs_volume+'</p>'+
							'<div class="red-font">'+bs_prom_text +'</div>'+
							'<div class="price orange-font">$<em>'+getPrice(product.bj_rsp)+'</em></div>'+
							'<div class="num">'+
								'<div class="mui-numbox" data-numbox-min="1" >'+
									'<button class="mui-btn mui-numbox-btn-minus" type="button">-</button>'+
									'<input class="mui-numbox-input" type="number" value="1" />'+
									' <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>'+
								'</div>'+
								'<div class="addCar">'+
									'Add<img src="' + MPJ.base + '/resources/images/icon/main-shopcar.png" />'+
								'</div>'+
							'</div>'+
						'</div>'+
					'</div>'+
					'</li>';
			}
		}

		if(obj.bc_group_r_pdt != undefined &&  obj.bc_group_r_pdt.bvc_pdt != undefined &&  obj.bc_group_r_pdt.bvc_pdt.length != 0){
			var bvc_pdt_r = obj.bc_group_r_pdt.bvc_pdt;
			for (var i = 0; i < bvc_pdt_r.length; i ++) {
				var product = bvc_pdt_r[i];
				var bs_prom_text=product.bs_prom_text == "" ? "" : product.bs_prom_text;
				bc_group_r_pdt+='<li>'+
					'<div class="mainCon">'+
						'<div class="imgBox">'+
							'<img src="'+MPJ.apiBase+''+product.bs_simg_file+'" />'+(product.bs_is_offer == "Y" ? '<span><em>offer</em></span>' : '')+
						'</div>'+
						'<div class="txtBox">'+
							'<h4>'+product.bs_brand+'</h4>'+
							'<p>'+product.bs_desc+' '+product.bs_volume+'</p>'+
							'<div class="red-font">'+bs_prom_text +'</div>'+
							'<div class="price orange-font">$<em>'+getPrice(product.bj_rsp)+'</em></div>'+
							'<div class="num">'+
								'<div class="mui-numbox" data-numbox-min="1" >'+
									'<button class="mui-btn mui-numbox-btn-minus" type="button">-</button>'+
									'<input class="mui-numbox-input" type="number" value="1" />'+
									'<button class="mui-btn mui-numbox-btn-plus" type="button">+</button>'+
								'</div>'+
								'<div class="addCar">'+
								'Add<img src="' + MPJ.base + '/resources/images/icon/main-shopcar.png" />'+
								'</div>'+
							'</div>'+
						'</div>'+
					'</div>'+
					'</li>';
			}
		}
		promotionArr.push(bc_group_a_pdt,bc_group_r_pdt);
	}

	return promotionArr;
}